home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / askmep.zip / ASKME.DOC next >
Text File  |  1992-07-03  |  3KB  |  83 lines

  1. (****************************************************)
  2. (* Askme Version 2.0  Written by Gary Bouchard      *)
  3. (* SysOp - The Computer Store BBS                   *)
  4. (* St. Augustine, Florida (904)794-0063             *)
  5. (* Copyright(c) 1992....All Rights Reserved         *)
  6. (* Released July 3, 1992    Modified                *)
  7. (****************************************************)
  8.  
  9.  
  10. A simple program that will count from XX to 0 where XX= the user defined
  11. time out, or the default of 10 seconds, then exit with an errorlevel set
  12. to a number based upon your answer or keyboard input. The program
  13. defaults to an affirmative (Yes) answer with errorlevel set to Zero (0)
  14. after a countdown from XX. Valid keys are 'Y', 'N', <ENTER>, or <Esc>.
  15.  
  16. On the command line you can place your question right after the program
  17. name, along with the time in seconds to countdown, and if you want a
  18. default answer set to NO, you can use a command line switch to change
  19. the default answer. Whatever the default answer is set to by you, the
  20. program will always exit with a 1 for NO, and a 0 for YES.
  21.  
  22. The calling syntax is like this;
  23.  
  24. C:>askme "question" [/Y<default> /N] [/Txx]
  25.  
  26. The parameters in [brackets] are optional, and allow you to modify the
  27. default values. If you want to use an optional value, do not use the
  28. brackets.
  29.  
  30. The /Y switch is the default, but it does not hurt to place it on the
  31. command line. The /N switch is to change the default answer to NO. The
  32. /Txx switch is the time in seconds the program should delay...example;
  33.  
  34. /T15 would make the program countdown from 15 to zero seconds. The
  35. default timeout is 10 seconds.
  36.  
  37. You can use either or both switches at the same time if desired.
  38.  
  39. To use the program in a batch file, place a line like so anywhere you
  40. desire to get the errorlevel set;
  41.  
  42. @echo off
  43. askme Is this a Test?  /t20
  44. if errorlevel 1 goto quit
  45. echo Hello World!
  46. :Quit
  47.  
  48. This example would wait 20 seconds, then exit with errorlevel set to
  49. zero (unless the <ESC> or N keys were pressed).
  50.  
  51. @echo off
  52. askme Is this a Test?  /t5 /n
  53. if errorlevel 1 goto quit
  54. echo
  55. Hello World!
  56. :Quit
  57.  
  58. This example would wait 5 seconds, and the default answer would be NO
  59. (errorlevel 1), so the program would jump to the label :QUIT.
  60.  
  61. The program will pass the parameters to ASKME in proper case for
  62. simplicity, and start the count.
  63.  
  64. This program is copyrighted(c) 1992, and is being distributed as
  65. *FREEWARE* in a non-commercial application. I maintain the rights to the
  66. source code, and will continue to support this program and enhance it,
  67. as long as there is interest in it. Call my BBS at the phone number
  68. above, for many more *FREEWARE* utilities.
  69.  
  70. History:
  71.  
  72. Ver 1.0 - My first Turbo Pascal program Released to Public!
  73.  
  74. Ver 1.1 - July 13, 1990, Corrected a typo, and turned off the DEBUG code
  75.           to make the program smaller and faster. Cosmetic change, and
  76.           fixed the counter...It was changing the system clock. Fixed!
  77.           Changed the logic of the counter to countdown instead of up.
  78.           Took out unused code to make it smaller and faster, though you
  79.           cant run much faster when you depend on the timer function.
  80.  
  81. Ver 2.0   July 3, 1992 - Completely rewritten in Turbo C++ 3.0, and
  82.           options added to make it more flexible. My First C program!
  83.